Crate bl602_macros[−][src]
Expand description
Macros for BL602 IoT SDK
Macros
Initialise a null-terminated bytestring Strn
that’s suitable for passing to Mynewt APIs
init_strn!("network")
expands to Strn{ rep: ByteStr(b"network\0") }
Used like this:
Given a static mutable variable, return an unsafe mutable pointer that’s suitable for passing to Mynewt APIs for writing output.
out!(NETWORK_TASK)
expands to unsafe { &mut NETWORK_TASK }
Create a Strn
containing a null-terminated byte string that’s suitable for passing to Mynewt APIs.
strn!("network")
expands to &Strn::new( b"network\0" )
.
strn!(())
expands to &Strn::new( b"\0" )
.
For macro calls like strn!( stringify!( value ) )
, return &Strn::new( b"value\0" )
.
For complex macro calls like strn!( $crate::parse!(@ json device_id) )
, return the parameter as is.
Transform a block of CBOR encoding calls by adding error checking. All lines must terminate with ;
Attribute Macros
Given an extern "C"
block of function declarations, generate the safe wrapper for the function